<?php
$title = 'Trang chủ';
$this->headTitle($title);
if (isset($_SESSION['user']['tendangnhap'])) {
?>


<script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <!-- Chèn đoạn code Javascript ở đây -->
<script type="text/javascript">
	
    //load the Google Visualization API and the chart
    google.load('visualization', '1', {'packages':['columnchart','piechart']});
 
    //set callback
    google.setOnLoadCallback (createChart);
 
    //callback function
    function createChart() {
 var jsonData = null;

    var json = $.ajax({
      url: window.location.href+"/getday", // make this url point to the data file
      dataType: "json",
      async: false,
      success: (
    function(data) {
        jsonData = data;

    // Create and populate the data table.
    var data = new google.visualization.DataTable(jsonData);

    // Create and draw the visualization.
  var chart= new google.visualization.ColumnChart(document.getElementById('chart')).
        draw(data, {curveType: "function",
                    width: 800, height: 400,
                    vAxis: {maxValue: 12}}
            );

    })
    }).responseText;
    }
</script> 
<script type="text/javascript">
	
    //load the Google Visualization API and the chart
    google.load('visualization', '1', {'packages':['columnchart','piechart']});
 
    //set callback
    google.setOnLoadCallback (createChart);
 
    //callback function
    function createChart() {
 var jsonData = null;

    var json = $.ajax({
      url: window.location.href+"/getmonth", // make this url point to the data file
      dataType: "json",
      async: false,
      success: (
    function(data) {
        jsonData = data;

    // Create and populate the data table.
    var data = new google.visualization.DataTable(jsonData);

    // Create and draw the visualization.
  var chart= new google.visualization.LineChart(document.getElementById('chart2')).
        draw(data, {curveType: "function",
                    width: 800, height: 400,
                    vAxis: {maxValue: 12}}
            );

    })
    }).responseText;
    }
</script> 


        <!--Divs for our charts -->
        <div id="chart"></div>
        <div id="chart2"></div>
Quản trị
<?php }
else{
	echo '<a href="'.$this->url("auth").'">'.$this->translate("Đăng nhập").'</a>';
}
 ?>